<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="cn.pzhu.jspdb.bean.User" %>
<%@ page import="java.util.List" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
	<a href="add.jsp">Add User</a>
	<table border="1">
		<tr>
			<td>ID</td>
			<td>LoginName</td>
			<td>Password</td>
			<td>Operate</td>
		</tr>
		<%
			
			List<User> users=(List<User>)request.getAttribute("USER_LIST");
			for(User u:users){ //foreach
		%>
		<tr>
			<td><%=u.getId() %></td>
			<td><%=u.getLoginName() %></td>
			<td><%=u.getPassword() %></td>
			<td>
				<a href="del?id=<%=u.getId()%>">Del</a>
				<a href="edit?id=<%=u.getId()%>">Edit</a>
			</td>
		</tr>
		<%
			}
		%>
	</table>
</body>
</html>